package patrol.mobile.com.mobilepatrol.activity.security.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyDrill3Activity;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyEvent2Activity;
import patrol.mobile.com.mobilepatrol.activity.security.emergency.EmergencyProtectCheckActivity;
import patrol.mobile.com.mobilepatrol.bean.Event1ListBean;

/**
 * Created by K on 2018/9/11.
 * des:
 */
public class EmergencyEvent1ListAdapter extends BaseQuickAdapter<Event1ListBean> {
    public EmergencyEvent1ListAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_emergency_event1_list;
    }

    @Override
    protected void convert(BaseViewHolder holder, final Event1ListBean item) {

        holder.setText(R.id.tv_num, (holder.getLayoutPosition()) + "");
        holder.setText(R.id.tv_eventName, item.getEventName());
        holder.setText(R.id.tv_glaces, item.getGlaces());
        holder.setText(R.id.dangerGlaces, item.getDangerGlaces());
        holder.setText(R.id.tv_orgName, item.getOrgName());
        holder.setText(R.id.tv_startTime, item.getStartTime());


        holder.setOnClickListener(R.id.rl_root, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(mContext, EmergencyEvent2Activity.class);
                intent.putExtra("id", item.getId());
                mContext.startActivity(intent);
            }
        });
    }
}
